package ch13;

import java.util.ArrayList;

public class Customer {
	private int customerID; // Customers account number
	private int pin; // PIN for authentication
	private long cpr; // Customers CPR
	private String firstName;// Customers full name
	private String lastName; // Customers last name
	private ArrayList<Account> accounts;

	// Customer constructor initializes attributes
	public Customer(int customerID, int pin, long cpr, String firstName,
			String lastName) {

		this.customerID = customerID;
		this.pin = pin;
		this.cpr = cpr;
		this.firstName = firstName;
		this.lastName = lastName;

		accounts = new ArrayList<Account>();
	} // end Customer constructor

	// determines whether a user-specified PIN matches PIN in Account
	public boolean validatePIN(int userPIN) {
		if (userPIN == pin)
			return true;
		else
			return false;
	} // end method validatePIN

	// return customerID
	public int getCustomerID() {
		return customerID;
	} // end method getAccountNumber

	// return CPR number
	public long getCpr() {
		return cpr;
	}// end getCpr method

	// return first name
	public String getFirstName() {
		return firstName;
	}// end getFirstName method

	// set first name
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}// end setFirstName method

	// set last name
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}// end setLastName

	// return first name
	public String getLastName() {
		return lastName;
	}// end getLastName

	// return pin
	public int getPin() {
		return pin;
	}// end getPin method

	// return accounts
	public ArrayList<Account> getAccounts() {
		return accounts;
	}//end method getAccounts

	// Adding accounts to costumers
	public void addAccounts(Account _accounts) {
		accounts.add(_accounts);
	}// End method add Accounts

	// removing accounts to costumers
	public void removeAccounts(Account _accounts) {
		accounts.remove(_accounts);
	}// End method remove Accounts

} // end Class Customer 
